﻿import QtQuick 2.4
import QtQuick.Controls 1.3
import QtQuick.Controls.Styles 1.3
import QtQuick.Dialogs 1.2
import QtQuick.Window 2.2

Item
{
    id:root
    height:100 *root.m_height
    //      height:900
    //    width:1525
    width:rightM
    property string getTime: ""
    property date stateTime
    property date tempTime
    property string year: ""
    property string mouth: ""
    property string day: ""
    property bool callingflag: false
    //确定日历是谁传递  true 为开始 false 为结束
    property bool choiceValue: true
    //确定小时是谁传递  true 为开始 false 为结束
    property bool choiceHourValue: false
    //确定小时是谁传递  true 为开始 false 为结束
    property bool choiceHourValue02: false
    //确定按钮是开还是关 true 开 false 关
    property bool openOrClose: true
    //确定刷新的是什么时间
    property bool updatePro: true
    //年月日时分秒
    property var endTimeStr : new Array(0);
    signal xiugaiSliverImage(int i)

    //获取全屏参数
    property double m_width:Screen.width/1920
    property double m_height:Screen.height/1080

    //字缩放比例
    property double m_pixRatio: (m_width +m_height)/2

    Component.onCompleted:
    {
        var  stodate =new Date()
        var  storage =new Date(stodate-6*24*3600*1000)
        getTimeValuee(storage,stodate)
    }

    Image
    {
        id:bg
        source: "./切图/时间轴/1.png"
        anchors.left: parent.left
        anchors.bottom:parent.bottom
//        width: 170 *root.m_width
//        height: 100 *root.m_height
        width: 170
        height: 100
    }
    Item
    {
        id:testItme
        anchors.left: bg.right
        anchors.bottom: parent.bottom
       // anchors.bottomMargin:8 *root.m_height
        //        width: parent.width - bg.width
        width: rightM - bg.width
//        height: 34 *root.m_height
        height: 39

        SliderMy
        {
            id:slider
            value: 0
            maximumValue:6
            minimumValue: 0

            width: parent.width
            //height: 10 *root.m_height
            anchors.bottom: bg.bottom
            //anchors.bottomMargin:7 *root.m_height
            tickmarksEnabled:true
            //            stepSize: 1
            onValueChanged:
            {
//                if(zhongTimeStr.length >0)
//                {

//                    if(slider.pressed ===true)
//                    {
//                        var zhi02 =  Math.floor(slider.value*100)/100
//                        var y02 = parseInt(zhi02)
//                        //                        //鼠标点着滑动
//                        if(y02 +((endInt-1)*7) < zhongTimeStr.length)
//                        {
//                            app.slotTimeBarChanged(zhongTimeStr[y02 +((endInt-1)*7)])
//                            if(updatePro === true)
//                            {
//                                mdata.text = slider.zhongTimeStr[y02 +((endInt-1)*7)].slice(0,10).replace("-",".").replace("-",".")
//                            }else
//                            {
//                                mtime.text = slider.zhongTimeStr[y02 +((endInt-1)*7)]
//                            }
//                        }



//                    }else
//                    {
//                        var zhi =  Math.floor(slider.value*100)/100
//                        var y = parseInt(slider.value)
//                        var y01 = parseInt(zhi)
//                        if (y ===0)
//                        {
//                            if(callingflag===false &&endInt===1)
//                            {
//                                //当为0的时候调动一次
//                                callingflag =true
//                                if(y01 +((endInt-1)*7) <zhongTimeStr.length)
//                                {
//                                    app.slotTimeBarChanged(zhongTimeStr[y01 +((endInt-1)*7)])
//                                    if(updatePro === true)
//                                    {
//                                        mdata.text = slider.zhongTimeStr[y01 +((endInt-1)*7)].slice(0,10).replace("-",".").replace("-",".")

//                                    }else
//                                    {
//                                        mtime.text = slider.zhongTimeStr[y01 +((endInt-1)*7)]
//                                    }

//                                }
//                                else
//                                {
//                                    if(loValue===true)
//                                    {
//                                        loValue=false
//                                        var tempendMothTimeStr02 = new Array(0)
//                                        var tempendHourTimeStr02 = new Array(0)
//                                        for(var i = 1*endInt *7 ; i< 7 *(endInt+1) ;i++)
//                                        {
//                                            tempendMothTimeStr02.push(mothTimeStr[i])
//                                            tempendHourTimeStr02.push(mothTimeStr[i])
//                                        }

//                                        endMothTimeStr = tempendMothTimeStr02
//                                        endHourTimeStr = tempendHourTimeStr02
//                                        if(0 +((endInt)*7) <zhongTimeStr.length)
//                                        {
//                                            //mdata.text值有变化
//                                            app.slotTimeBarChanged(zhongTimeStr[0 +((endInt)*7)])
//                                            //                                         mdata.text = slider.zhongTimeStr[0 +((endInt)*7)].slice(0,10).replace("-",".").replace("-",".")
//                                            if(updatePro === true)
//                                            {
//                                                mdata.text = slider.zhongTimeStr[0 +((endInt)*7)].slice(0,10).replace("-",".").replace("-",".")
//                                            }
//                                            else
//                                            {
//                                                mtime.text = slider.zhongTimeStr[0 +((endInt)*7)]
//                                            }
//                                        }

//                                    }

//                                }

//                            }
//                        }else
//                        {
//                            if(value >=5.99)
//                            {
//                                if(6 +((endInt-1)*7) <zhongTimeStr.length)
//                                {
//                                    app.slotTimeBarChanged(zhongTimeStr[6 +((endInt-1)*7)])
//                                    if(updatePro === true)
//                                    {
//                                        mdata.text = slider.zhongTimeStr[6 +((endInt-1)*7)].slice(0,10).replace("-",".").replace("-",".")
//                                    }
//                                    else
//                                    {
//                                        mtime.text = slider.zhongTimeStr[6 +((endInt-1)*7)]
//                                    }
//                                }else
//                                {

//                                    var ii = zhi/y
//                                    if(ii ===1)
//                                    {
//                                        //主要调动
//                                        if(y01 +((endInt-1)*7) <zhongTimeStr.length)
//                                        {
//                                            app.slotTimeBarChanged(zhongTimeStr[y01 +((endInt-1)*7)])
//                                            if(updatePro === true)
//                                            {
//                                                mdata.text = slider.zhongTimeStr[y01 +((endInt-1)*7)].slice(0,10).replace("-",".").replace("-",".")
//                                            }
//                                            else
//                                            {
//                                                mtime.text =slider.zhongTimeStr[y01 +((endInt-1)*7)]
//                                            }
//                                        }
//                                    }
//                                }
//                            }
//                        }
//                    }

//                }
                if(zhongTimeStr.length >0)
                {
                    if(slider.pressed ===true)
                    {
                        var zhi02 =  Math.floor(slider.value*100)/100
                        var y02 = parseInt(zhi02)
//                        //鼠标点着滑动
                        if(y02 +((endInt-1)*7) < zhongTimeStr.length)
                        {
//                            if(updatePro === true)
//                            {
//                                app.slotTimeBarChanged(zhongTimeStr[y02 +((endInt-1)*7)])
//                                mdata.text = slider.zhongTimeStr[y02 +((endInt-1)*7)].slice(0,10).replace("-",".").replace("-",".")
//                            }else
//                            {
//                                mtime.text = slider.zhongTimeStr[y02 +((endInt-1)*7)]
//                            }

                            if(updatePro === true)
                            {
                                app.slotTimeBarChanged(zhongTimeStr[y02 +((endInt-1)*7)],"day")
                                mdata.text = slider.zhongTimeStr[y02 +((endInt-1)*7)].slice(0,10).replace("-",".").replace("-",".")
                            }
                            else
                            {
                                var tempTu = mdata.text.replace(".","-").replace(".","-")
                                var tempTi =zhongTimeStr[y02 +((endInt-1)*7)]
                                if(zhongTimeStr[y02 +((endInt-1)*7)].length ===0)
                                {
                                    tempTi = "24:00:00"
                                }
                                tempTu = tempTu + " " + tempTi
                                app.slotTimeBarChanged(tempTu,"hour")
                                mtime.text =slider.zhongTimeStr[y02 +((endInt-1)*7)]
                            }
                        }



                    }else
                    {

                        var zhi =  Math.floor(slider.value*100)/100
                        var y = parseInt(slider.value)
                        var y01 = parseInt(zhi)
                        if (y ===0)
                        {
                            if(callingflag===false &&endInt===1)
                            {
                                //当为0的时候调动一次
                                callingflag =true
                                if(y01 +((endInt-1)*7) <zhongTimeStr.length)
                                {

                                    if(updatePro === true)
                                    {
                                        //app.slotTimeBarChanged(zhongTimeStr[y01 +((endInt-1)*7)],"day")
                                        app.slotTimeBarChanged(zhongTimeStr[y01 +((endInt-1)*7)],"day")
                                        mdata.text = slider.zhongTimeStr[y01 +((endInt-1)*7)].slice(0,10).replace("-",".").replace("-",".")
                                    }
                                    else
                                    {
                                        var tempTu01 = mdata.text.replace(".","-").replace(".","-")
                                        var tempTi01 = zhongTimeStr[y01 +((endInt-1)*7)]
                                        if(zhongTimeStr[y01 +((endInt-1)*7)].length ===0)
                                        {
                                            tempTi01 = "24:00:00"
                                        }
                                        tempTu01 = tempTu01 + " " + tempTi01
                                        //(tempTu01,"hour")
                                        app.slotTimeBarChanged(tempTu01,"hour")
                                        mtime.text =slider.zhongTimeStr[y01 +((endInt-1)*7)]
                                    }

                                }

                            }
                            else
                            {
                                if(loValue===true)
                                {
                                     loValue=false
                                    var tempendMothTimeStr02 = new Array(0)
                                    var tempendHourTimeStr02 = new Array(0)
                                    for(var i = 1*endInt *7 ; i< 7 *(endInt+1) ;i++)
                                    {
                                        tempendMothTimeStr02.push(mothTimeStr[i])
                                        tempendHourTimeStr02.push(mothTimeStr[i])
                                    }

                                    endMothTimeStr = tempendMothTimeStr02
                                    endHourTimeStr = tempendHourTimeStr02
                                    if(0 +((endInt)*7) <zhongTimeStr.length)
                                    {
                                        //mdata.text值有变化
                                        if(updatePro === true)
                                        {
                                            //当第二遍刷新的时候 不需要在更新值了
                                           // app.slotTimeBarChanged(zhongTimeStr[0 +((endInt)*7)],"day")
                                            mdata.text = slider.zhongTimeStr[0 +((endInt)*7)].slice(0,10).replace("-",".").replace("-",".")
                                        }
                                        else
                                        {
                                            var tempTu02 = mdata.text.replace(".","-").replace(".","-")
                                            var tempTi02 = zhongTimeStr[0 +((endInt)*7)]
                                            if(zhongTimeStr[0 +((endInt)*7)].length ===0)
                                            {
                                                tempTi02 = "24:00:00"
                                            }
                                            tempTu02 = tempTu02 + " " + tempTi02
                                            ////当第二遍刷新的时候 不需要在更新值了
//                                            app.slotTimeBarChanged(tempTu02,"hour")
                                            mtime.text =slider.zhongTimeStr[0 +((endInt)*7)]
                                        }

                                    }

                                }

                            }
                        }else
                        {
                            if(value >=5.99)
                            {
                                if(6 +((endInt-1)*7) <zhongTimeStr.length)
                                {
//                                     app.slotTimeBarChanged(zhongTimeStr[6 +((endInt-1)*7)])
//                                    if(updatePro === true)
//                                    {
//                                        mdata.text = slider.zhongTimeStr[6 +((endInt-1)*7)].slice(0,10).replace("-",".").replace("-",".")
//                                    }
//                                    else
//                                    {
//                                        mtime.text = slider.zhongTimeStr[6 +((endInt-1)*7)]
//                                    }

                                    if(updatePro === true)
                                    {
                                        app.slotTimeBarChanged(zhongTimeStr[6 +((endInt-1)*7)],"day")
                                        mdata.text = slider.zhongTimeStr[6 +((endInt-1)*7)].slice(0,10).replace("-",".").replace("-",".")
                                    }
                                    else
                                    {
                                        var tempTu03 = mdata.text.replace(".","-").replace(".","-")
                                        var tempTi03 = zhongTimeStr[6 +((endInt-1)*7)]
                                        if(zhongTimeStr[6 +((endInt-1)*7)].length ===0)
                                        {
                                            tempTi03 = "24:00:00"
                                        }
                                        tempTu03 = tempTu03 + " " + tempTi03
                                        app.slotTimeBarChanged(tempTu03,"hour")
                                        mtime.text =slider.zhongTimeStr[6 +((endInt-1)*7)]
                                    }
                                }
                            }else
                            {
                                var ii = zhi/y
                                 if(ii ===1)
                                {
                                    //主要调动
                                    if(y01 +((endInt-1)*7) <zhongTimeStr.length)
                                    {
                                        if(updatePro === true)
                                        {

                                            app.slotTimeBarChanged(zhongTimeStr[y01 +((endInt-1)*7)],"day")
                                            mdata.text = slider.zhongTimeStr[y01 +((endInt-1)*7)].slice(0,10).replace("-",".").replace("-",".")
                                        }
                                        else
                                        {
                                            var tempTu04 = mdata.text.replace(".","-").replace(".","-")
                                            var tempTi04 = zhongTimeStr[y01 +((endInt-1)*7)]
                                            if(zhongTimeStr[y01 +((endInt-1)*7)].length ===0)
                                            {
                                                tempTi04 = "24:00:00"
                                            }
                                            tempTu04 = tempTu04 + " " + tempTi04
                                            app.slotTimeBarChanged(tempTu04,"hour")
                                            mtime.text =slider.zhongTimeStr[y01 +((endInt-1)*7)]
                                        }
                                    }
                                }
                            }
                        }
                    }
                }

            }
        }
        }
        Row
        {
            width:root.height/100*(bg.width)
            height:bg.height
            anchors.bottom:bg.bottom
            anchors.bottomMargin:-70
            anchors.left:bg.left
            anchors.leftMargin:29
            spacing:18
            Image
            {
                id:begin
                source:"./切图/时间轴/当前时间-拷贝.png"
//                width: 17*root.m_width
//                height: 19*root.m_height
                width: 17
                height: 19
                enabled:true
                opacity:1
                MouseArea
                {
                    anchors.fill:parent
                    hoverEnabled: true
                    onPressed:
                    {
                        begin.opacity=0.7
                    }
                    onReleased:
                    {
                        begin.opacity=1
                    }
                    onClicked:
                    {
                        emit: slider.restart()
                        openOrClose=true
                        stop.source = "./切图/时间轴/播放-拷贝.png"
                    }
                }

            }
            Image
            {
                id:stop
                source:"./切图/时间轴/播放-拷贝.png"
//                width: 12 *root.m_width
//                height: 19 *root.m_height
                width: 12
                height: 19
                MouseArea
                {
                    anchors.fill:stop
                    onPressed:
                    {
                        //                    stop.opacity=0.7
                        if(openOrClose===true)
                        {
                            stop.source = "./切图/时间轴/暂停.png"
                            openOrClose = false
                        }else
                        {
                            //                        stop.source = "./切图/时间轴/暂停.png"
                            stop.source = "./切图/时间轴/播放-拷贝.png"
                            openOrClose = true
                        }

                    }

                    onClicked:
                    {
                        if(openOrClose===true)
                        {

                            emit: slider.endSliver()
                        }else
                        {
                            emit: slider.openSliver()
                        }
                    }
                }
            }
            Image
            {
                id:currentTime
                source: "./切图/时间轴/日历.png"
//                width: 16 *root.m_width
//                height: 18 *root.m_height
                width: 16
                height: 18
                MouseArea
                {
                    anchors.fill:currentTime
                    onPressed:
                    {
                        currentTime.opacity=0.7
                    }
                    onReleased:
                    {
                        currentTime.opacity=1
                    }
                    onClicked:
                    {
                        colseAppRan()
                        timeChoice.visible = true
                    }
                }
            }

        }

        Text{
            id:mdata
            text:new Date().toLocaleDateString(Qt.locale("de_DE"),"yyyy.MM.dd")
            color:"white"
//            anchors.left:bg.left
            anchors.top: bg.top
//            anchors.verticalCenter: bg.verticalCenter
            anchors.horizontalCenter: bg.horizontalCenter
            anchors.horizontalCenterOffset: -15
//            anchors.topMargin: 50 *root.m_height
//            anchors.leftMargin:34 *root.m_width
            anchors.topMargin: 50
//            anchors.leftMargin:44
            font.family: "黑体"
            font.pixelSize: 15 
            MouseArea
            {
                anchors.fill: parent
                onClicked:
                {
                    colseAppRan()
                    timeChoice.visible = true

                }
            }
        }
        //弹出的界面
        Item {
            id: timeChoice
            visible: false
            implicitWidth : toolboxsubmenuBg.width
            implicitHeight: toolboxsubmenuBg.height
            anchors.bottom: bg.top
            anchors.left: parent.left
            anchors.leftMargin: 10
            anchors.bottomMargin: 10
            MouseArea
            {
                anchors.fill: parent
            }
            Image
            {
                id:toolboxsubmenuBg
                source:"./切图/时间轴/web/时间底子.png"
            }
            Row
            {
                spacing: 15
                id:dayTimeOrHourTime
                anchors.horizontalCenter:  parent.horizontalCenter
                anchors.top: timeChoice.top
                anchors.topMargin: 48

                Image
                {
                    id:dayImage
                    source:"./切图/时间轴/web/天选择.png"
                    MouseArea
                    {
                        anchors.fill: parent
                        onClicked:
                        {
                            dayImage.source = "./切图/时间轴/web/天选择.png"
                            hourImage.source = "./切图/时间轴/web/小时.png"
                            hourTimeItem.visible = false
                            dayTimeItem.visible =true

                        }
                    }
                }
                Image {
                    id:hourImage
                    source:"./切图/时间轴/web/小时.png"
                    MouseArea
                    {
                        anchors.fill: parent
                        onClicked:
                        {
                            dayImage.source = "./切图/时间轴/web/天.png"
                            hourImage.source = "./切图/时间轴/web/小时选择.png"
                            dayTimeItem.visible =false
                            hourTimeItem.visible = true
                            calender.visible = false
                        }
                    }
                }

            }

            Item
            {
                id:dayTimeItem
                anchors.top: dayTimeOrHourTime.bottom
                anchors.topMargin: 22
                anchors.bottom: decideOrCancel.top
                anchors.bottomMargin: 5
                anchors.horizontalCenter:  parent.horizontalCenter
                Column
                {
                    anchors.horizontalCenter:  parent.horizontalCenter
                    anchors.top:  parent.top
                    anchors.topMargin: 6
                    anchors.bottom: parent.bottom
                    anchors.bottomMargin: 5
                    spacing: 34

                    Row
                    {
                        spacing: 10
                        Text
                        {

                            font.family: "黑体"
                            font.pixelSize: 18
                            text:"开始时间:"
                            color:"white"
                        }
                        Column
                        {
                            spacing: -14
                            TextInput
                            {
                                id:dayTimeItemText
                                text:"   2017-01-01"
                                cursorVisible: false
                                color:"white"
                                font.family: "黑体"
                                font.pixelSize: 16
                                width: 128
                                height: 16
                                validator: RegExpValidator{regExp: /\s{3}([0-9]{3}[1-9]|[0-9]{2}[1-9][0-9]{1}|[0-9]{1}[1-9][0-9]{2}|[1-9][0-9]{3})-(((0[13578]|1[02])-(0[1-9]|[12][0-9]|3[01]))|((0[469]|11)-(0[1-9]|[12][0-9]|30))|(02-(0[1-9]|[1][0-9]|2[0-8])))/}

                            }
                            Text
                            {
                                font.family: "黑体"
                                font.pixelSize:16
                                text:"________________"
                                color:"white"
                            }
                        }

                        Image {
                            source: "./切图/时间轴/日历.png"
                            MouseArea
                            {
                                anchors.fill: parent
                                onClicked:
                                {
                                    calender.visible =true
                                    choiceValue = true
                                }
                            }
                        }
                    }
                    Row
                    {
                        spacing: 10
                        Text
                        {
                            font.family: "黑体"
                            font.pixelSize: 18
                            text:"结束时间:"
                            color:"white"
                        }
                        Column
                        {
                            spacing: -14
                            TextInput
                            {
                                id:dayEndTimeItemText
                                text: "   2017-01-23"
                                cursorVisible: false
                                color:"white"
                                font.family: "黑体"
                                font.pixelSize: 16
                                width: 128
                                height: 16
                                validator: RegExpValidator{regExp: /\s{3}([0-9]{3}[1-9]|[0-9]{2}[1-9][0-9]{1}|[0-9]{1}[1-9][0-9]{2}|[1-9][0-9]{3})-(((0[13578]|1[02])-(0[1-9]|[12][0-9]|3[01]))|((0[469]|11)-(0[1-9]|[12][0-9]|30))|(02-(0[1-9]|[1][0-9]|2[0-8])))/}

                            }
                            Text
                            {
                                id:textBack
                                font.family: "黑体"
                                font.pixelSize:16
                                text:"________________"
                                color:"white"
                            }
                        }

                        Image {
                            source: "./切图/时间轴/日历.png"
                            MouseArea
                            {
                                anchors.fill: parent
                                onClicked:
                                {
                                    calender.visible =true
                                    choiceValue = false
                                }
                            }
                        }
                    }
                }


            }
            Item
            {
                id:hourTimeItem
                anchors.top: dayTimeOrHourTime.bottom
                anchors.topMargin: 22
                anchors.bottom: decideOrCancel.top
                anchors.bottomMargin: 5
                anchors.horizontalCenter:  parent.horizontalCenter
                visible: false
                Column
                {
                    anchors.horizontalCenter:  parent.horizontalCenter
                    anchors.top:  parent.top
                    anchors.topMargin: 6
                    anchors.bottom: parent.bottom
                    anchors.bottomMargin: 5
                    spacing: 34

                    Row
                    {
                        spacing: 10
                        Text
                        {
                            font.family: "黑体"
                            font.pixelSize: 18
                            text:"开始时间:"
                            color:"white"
                        }
                        Column
                        {
                            spacing: -14
                            Text
                            {
                                id:hourTimeItemText
                                font.family: "黑体"
                                font.pixelSize: 16
                                text: new Date().toLocaleString(Qt.locale("de_DE"),"yyyy-MM-dd ")+"00:00:00"
                                color:"white"

                                MouseArea
                                {
                                    id:hourTimeItemTextAre
                                    anchors.fill: parent
                                    onClicked:
                                    {

                                        choiceHourValue = true
                                        calender02.visible =true

                                    }
                                }
                            }
                            Text
                            {
                                font.family: "黑体"
                                font.pixelSize:16
                                text:"___________________"
                                color:"white"
                            }
                        }

                    }
                    Row
                    {
                        spacing: 10
                        Text
                        {
                            font.family: "黑体"
                            font.pixelSize: 18
                            text:"结束时间:"
                            color:"white"
                        }
                        Column
                        {
                            spacing: -14
                            Text
                            {
                                id:hourEndTimeItemText
                                font.family: "黑体"
                                font.pixelSize: 16
                                text:new Date().toLocaleString(Qt.locale("de_DE"),"yyyy-MM-dd ")+"24:00:00"
                                color:"white"
                                MouseArea
                                {
                                    id:hourEndTimeItemTextAre
                                    anchors.fill: parent
                                    onClicked:
                                    {
                                        choiceHourValue02 = true
                                        calender02.visible =true

                                    }
                                }
                            }
                            Text
                            {
                                font.family: "黑体"
                                font.pixelSize:16
                                text:"___________________"
                                color:"white"
                            }
                        }

                    }
                }

            }

            Row
            {
                id:decideOrCancel
                anchors.horizontalCenter:  parent.horizontalCenter
                anchors.bottom: toolboxsubmenuBg.bottom
                anchors.bottomMargin: 18
                spacing: 38
                Image {
                    id: decideImage
                    source: "./切图/时间轴/web/确定.png"
                    MouseArea
                    {
                        anchors.fill: parent
                        onPressed: {
                            decideImage.source = "./切图/时间轴/web/确定点击.png"
                        }
                        onReleased:
                        {
                            decideImage.source = "./切图/时间轴/web/确定.png"
                        }
                        onClicked:
                        {

                            if(dayTimeItem.visible===true)
                            {
                                calender.visible = false
                                var z =  new Date(dayTimeItemText.text.slice(3,7),parseInt(dayTimeItemText.text.slice(8,10))-1,dayTimeItemText.text.slice(11,13))
                                var u =  new Date(dayEndTimeItemText.text.slice(3,7),parseInt(dayEndTimeItemText.text.slice(8,10))-1,dayEndTimeItemText.text.slice(11,13))
                                if (Date.parse(u) - Date.parse(z) < 0 || Date.parse(u) - Date.parse(z)  > 2678400000)
                                {
                                    schedulesMessageYes.visible = true
                                }
                                else
                                {

                                    //                                var  storage =new Date().toLocaleString(Qt.locale("de_DE"),"yyyy-MM-dd hh:mm:ss")
                                   app.slotTimeUpData(new Date(z).toLocaleString(Qt.locale("de_DE"),"yyyy-MM-dd"),new Date(u).toLocaleString(Qt.locale("de_DE"), "yyyy-MM-dd"))

                                    var  stodate =new Date()
                                    var  storage =new Date(stodate-7*24*3600*1000)
                                    //传递时间 z 开始时间 u结束时间
                                    getTimeValuee(z,u)
                                    timeChoice.visible = false


                                }
                            }else
                            {
                                //todo
                                calender02.visible = false
                                calender.visible = false
                                 timeChoice.visible = false

                                var zz = new  Date(hourTimeItemText.text) .toLocaleString(Qt.locale("de_DE"),"yyyy-MM-dd")
                                //                            var uu = new  Date(hourEndTimeItemText.text)
                                gethourTimeValuee(zz)
                                //                             timeChoice.visible = false
                                //                            var zz = parseInt(hourEndTimeItemText.text.slice(3,5))
                                //                            var uu = parseInt(hourTimeItemText.text.slice(3,5))

                                //                            hourTimeItemText.text = String(z) + " 00:00:00"
                                //                            hourEndTimeItemText.text =  String(z)+" 24:00:00"
                                //                            if (zz-uu <=0)
                                //                            {
                                //                                schedulesMessageYes.visible = true
                                //                            }
                                //                            else
                                //                            {
                                //                                timeChoice.visible = false

                                //                                var zlx =  new Date()
                                //                                var zly =   new Date()
                                //                                zlx.setHours(zz)
                                //                                zlx.setUTCMinutes(0)
                                //                                zlx.setSeconds(0)

                                //                                zly.setHours(uu)
                                //                                zly.setUTCMinutes(0)
                                //                                zly.setSeconds(0)
                                //                                //传递时间 zlx 开始时间 zly结束时间
                                //                            }


                            }


                        }
                    }
                }
                Image {
                    id: cancelImage
                    source: "./切图/时间轴/web/取消.png"
                    MouseArea
                    {
                        anchors.fill: parent
                        onPressed: {
                            cancelImage.source = "./切图/时间轴/web/取消点击.png"
                        }
                        onReleased:
                        {
                            cancelImage.source = "./切图/时间轴/web/取消.png"
                        }
                        onClicked:
                        {
                            timeChoice.visible = false
                            calender.visible = false
                            //                       schedulesMessageYes.visible = true
                        }
                    }
                }
            }

        }

        //选择的日历
        Calendar {
            id:calender
            visible: false
            anchors.left: timeChoice.right
            anchors.top: timeChoice.top
            height: timeChoice.height
            onClicked:
            {
                var z = date.toLocaleString(Qt.locale("de_DE"),"yyyy-MM-dd")
                calender.visible= false
                if(choiceValue===true)
                {
                    dayTimeItemText.text = "   " + z
                }else
                {
                    dayEndTimeItemText.text = "   " + z
                }
            }
        }
        //选择的小时日历
        Calendar {
            id:calender02
            visible: false
            anchors.left: timeChoice.right
            anchors.top: timeChoice.top
            height: timeChoice.height
            onClicked:
            {
                var z = date.toLocaleString(Qt.locale("de_DE"),"yyyy-MM-dd")
                calender02.visible= false
                if(choiceHourValue===true || choiceHourValue02===true)
                {
                    hourTimeItemText.text = String(z) + " 00:00:00"
                    hourEndTimeItemText.text =  String(z)+" 24:00:00"
                    choiceHourValue =false
                    choiceHourValue02 =false
                }
            }
        }

        //警告信息
        MessageDialog{
            id:  schedulesMessageYes;
            visible: false
            title: "警告！";
            text: dayTimeItem.visible ?  "结束时间在开始时间之前或者开始时间与结束时间间隔超过一个月，请从新选择时间。" :"结束时间在开始时间之前，请从新选择时间";
        }



        Text{
            id:mtime
            //        text:new Date().toLocaleTimeString()
            text:"00:00:00"
            color:"white"
            anchors.bottom: mdata.top
//            anchors.bottomMargin: parent.height/100*8
            anchors.bottomMargin: 8
//            anchors.left:bg.left
//            anchors.leftMargin: 40 *root.m_width
//            anchors.leftMargin: 50
            anchors.horizontalCenter: bg.horizontalCenter
            anchors.horizontalCenterOffset: -15
            font.family: "黑体"
            font.pixelSize: 15 

        }
        Component//littleBox
        {
            id:checkStyle
            CheckBoxStyle
            {
                indicator:
                    Rectangle
                {
                implicitHeight:littleBox.height
                implicitWidth:littleBox.width
                // border.color:control.hovered?Qt.rgba(91/255,231/255,196/255,1):
                border.color:"gray"
                focus:true
                Image
                {
                    id:littleBox
                    source:control.checked?"./切图/图层管理/小框点击.png":"./切图/图层管理/小框.png"
                }
            }

            label:
                Text
            {
            font.pixelSize: 12
            text:control.text
            font.family: "微软雅黑"
            //color:control.hovered?Qt.rgba(91/255,231/255,196/255,1):"white"
            color:"white"
        }
    }

}



function getTimeValuee(x,y)
{
//    updatePro = true
//    var maxDay =  (((y -x)/86400000) +1)
//    var maxDays= (((y -x)/86400000) +1)%7
//    if(maxDays!=0)
//    {
//        maxDay = maxDay + 7 -maxDays
//    }
//    var runInt = maxDay/7
//    var endMothTimeStr = new Array(0);
//    var storage001 = new Array(0);
//    var zzz = (((y -x)/86400000) +1)
//    var zzzz = 0
//    for (var i =0; i <= maxDay-1; i++)
//    {
//        var timeMs = Date.parse(x) +86400000 * i

//        var  storage =new Date(timeMs).toLocaleString(Qt.locale("de_DE"),"yyyy-MM-dd hh:mm:ss")
//        if(zzzz <zzz)
//        {
//            storage001.push(storage)
//            zzzz ++;
//        }
//        endMothTimeStr.push(storage.slice(5,7)+"月" +storage.slice(8,10) + "日")

//    }
//    //运行次数 刻度显示 滑块显示
//    slider.getArray(runInt,endMothTimeStr,storage001)

//    mdata.text = storage001[0].slice(0,10).replace("-",".").replace("-",".")
    updatePro = true
    var maxDay =  (((y -x)/86400000) +1)

    var maxDays= (((y -x)/86400000) +1)%7
     //刻度线
    var runInt = parseInt(maxDay/7)
    var endMothTimeStr = new Array(0);
    var storage001 = new Array(0);
//    var zzz = (((y -x)/86400000) +1)
    var zzz
    var zzzz = 0
    if(maxDays===0&& runInt===1)
    {
        zzz = (((y -x)/86400000) +1)
        for (var i =0; i <= maxDay-1; i++)
        {
            var timeMs = Date.parse(x) +86400000 * i

            var  storage =new Date(timeMs).toLocaleString(Qt.locale("de_DE"),"yyyy-MM-dd hh:mm:ss")
            if(zzzz <zzz)
            {
                storage001.push(storage)
                zzzz ++;
            }
            endMothTimeStr.push(storage.slice(5,7)+"月" +storage.slice(8,10) + "日")

        }
//        //运行次数 刻度显示 滑块显示
//        slider.getArray(runInt,endMothTimeStr,storage001)
//        mdata.text = storage001[0].slice(0,10).replace("-",".").replace("-",".")

    }else
    {
        var runInt02 = runInt
        var maxDay02 = (maxDay +runInt)%7
        if(maxDay02!=0)
        {
            zzz = (((y -x)/86400000) +1)
            maxDay = (maxDay +runInt) + 7 -maxDay02
            zzz = (((y -x)/86400000) +1)
            for (var i2 =0; i2 <= maxDay-1-runInt; i2++)
            {
                var timeMs02 = Date.parse(x) +86400000 * i2

                var  storage02 =new Date(timeMs02).toLocaleString(Qt.locale("de_DE"),"yyyy-MM-dd hh:mm:ss")
                if(zzzz <zzz)
                {
                    storage001.push(storage02)
                    zzzz ++;
                }
                endMothTimeStr.push(storage02.slice(5,7)+"月" +storage02.slice(8,10) + "日")

            }
            for(var i3=1;i3<=runInt02;i3++)
            {
                if(i3*7 <endMothTimeStr.length )
                {
                    endMothTimeStr.splice(i3*7, 0, endMothTimeStr[i3*7-1]);
                }
                storage001.splice(i3*7, 0, storage001[i3*7-1]);

            }

            runInt =maxDay/7


        }
        else
        {
           zzz = (((y -x)/86400000) +1)
            maxDay = (maxDay +runInt)

            for (var i4 =0; i4 <= maxDay-1-runInt; i4++)
            {
                var timeMs04 = Date.parse(x) +86400000 * i4

                var  storage04 =new Date(timeMs04).toLocaleString(Qt.locale("de_DE"),"yyyy-MM-dd hh:mm:ss")
                if(zzzz <zzz)
                {
                  storage001.push(storage04)
                    zzzz ++;
                }
                endMothTimeStr.push(storage04.slice(5,7)+"月" +storage04.slice(8,10) + "日")
            }
            for(var i5=1;i5<=runInt02;i5++)
            {
                if(i5*7 <endMothTimeStr.length )
                {
                    endMothTimeStr.splice(i5*7, 0, endMothTimeStr[i5*7-1]);
                }
                storage001.splice(i5*7, 0, storage001[i5*7-1]);

            }

            runInt =maxDay/7

        }

    }
    //运行次数 刻度显示 滑块显示
    slider.getArray(runInt,endMothTimeStr,storage001)

    mdata.text = storage001[0].slice(0,10).replace("-",".").replace("-",".")

}

function gethourTimeValuee(x)
{
    updatePro = false
    var runInt = 4
    var endMothTimeStr = new Array(0);
    var storage001 = new Array(0);
    for (var i =0; i <= 24; i++)
    {
        var uit
        if(i<10)
        {
            uit = "0" +i
        }else
        {
            uit = i
        }

        if(i>24)
        {

        }else
        {
            var u =  uit + ":00:00"
            storage001.push(u)
            endMothTimeStr.push(u)

        }
    }

    for(var i5=1;i5<=3;i5++)
    {
        if(i5*7 <endMothTimeStr.length )
        {
            endMothTimeStr.splice(i5*7, 0, endMothTimeStr[i5*7-1]);
        }
        storage001.splice(i5*7, 0, storage001[i5*7-1]);

    }
    //运行次数 刻度显示 滑块显示
    slider.getArray(runInt,endMothTimeStr,storage001)
    mdata.text = x.replace("-",".").replace("-",".")
    mtime.text = storage001[0]

}

function colseAppRan()
{
    raning.visible = false
    detaSh.visible = false
//    menu.replaceSite();
}
Connections
{
    onXiugaiSliverImage:
    {


        //0为不改变状态
        if(i===0)
        {
            openOrClose =true
            stop.source = "./切图/时间轴/播放-拷贝.png"
        }else
        {
            openOrClose = true
            stop.source = "./切图/时间轴/播放-拷贝.png"
        }
    }
}
}
